<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head></head>
<body style="width: 2000px;">
<script type="text/javascript">
 $(function(){
	//初始化表单验证
	$("#addForm").validate({
		rules: {
			gbprice: {isMoney: true},
			zspointnum:{isMoney: true},
			zsdedunum:{isMoney: true},
			zscouponnum:{isMoney: true},
			marketPrice: {isMoney: true},
			sellPrice: {isMoney: true},
			sellerprice: {isMoney: true},
			
			oppoint: {isMoney: true},
			opdedu: {isMoney: true},
			opcoupon: {isMoney: true},
			
			muchsellerprice: {isMoney: true},
			mppoint: {isMoney: true},
			mpdedu: {isMoney: true},
			mpcoupon: {isMoney: true},
			
			price:{isMoney: true},
			stock:{digits: true},		
			zdsx:{digits: true},
			yyts:{digits: true},
			jyrs:{digits: true},
			zdrs:{digits: true},
		},
		messages:{
			gbprice: {required: "请输入团购销售价",isMoney: "请填写正确的金额，最多保留两位小数位"},
			zspointnum: {required: "请输入数字",isMoney: "请填写正确的积分值，最多保留两位小数位"},
			zsdedunum: {required: "请输入抵扣券",isMoney: "请填写正确的积分值，最多保留两位小数位"},
			zscouponnum: {required: "请输入优惠券",isMoney: "请填写正确的积分值，最多保留两位小数位"},
			
			/* marketPrice: {required: "请输入商品分公司价",isMoney: "请填写正确的金额，最多保留两位小数位"}, */
			sellPrice: {required: "请输入市场价格",isMoney: "请填写正确的支付金额，最多保留两位小数位"},
			sellerprice: {required: "请输入支付金额",isMoney: "请填写正确的支付金额，最多保留两位小数位"},
			
			oppoint: {required: "请输入数字",isMoney: "请填写正确的积分值，最多保留两位小数位"},
			opdedu: {required: "请输入数字",isMoney: "请填写正确的积分值，最多保留两位小数位"},
			opcoupon: {required: "请输入数字",isMoney: "请填写正确的积分值，最多保留两位小数位"},
			
			muchsellerprice: {required: "请输入支付金额",isMoney: "请填写正确的支付金额，最多保留两位小数位"},
			mppoint: {required: "请输入数字",isMoney: "请填写正确的积分值，最多保留两位小数位"},
			mpdedu: {required: "请输入数字",isMoney: "请填写正确的积分值，最多保留两位小数位"},
			mpcoupon: {required: "请输入数字",isMoney: "请填写正确的积分值，最多保留两位小数位"},	
			price: {required: "请输入价值",isMoney: "请填写正确的价值，最多保留两位小数位"},
			
			stock: {required: "请输入商品库存",digits: "请填写正确的数量"},
			zdsx: {required: "请输入正确的指定上限",digits: "请填写正确的数量"},
			yyts: {required: "请输入商品库存",digits: "请填写正确的数量"},
			jyrs: {required: "请输入正确的建议",digits: "请填写正确的数量"},
			zdrs: {required: "请输入正确的指定人数",digits: "请填写正确的数量"},
			categoryonid: {required: "请选择一级分类"},
			categorytwid: {required: "请选择二级分类"},
			categorythid: {required: "请选择三级分类"},
			categoryfoid: {required: "请选择四级分类"}
		},
		submitHandler:function(form){
			$(form).ajaxSubmit({
				success:function(data){
					switch(data.flag){
					case 2:
						Kit.alert("请选择商品分类");return;
					case 3:
						Kit.alert("请选择要增加分公司");return;
					/* case 4:
						Kit.alert("请添加门市价");return;  */
					case 5:
						Kit.alert("请添加库存");return;
					case 6:
						Kit.alert("请添加客服二维码");return;
					case 7:
						Kit.alert("Logo图片不能为空！");return;
					case 8:
						Kit.alert("请添加价格");return;
					case 9:
						Kit.alert("请添加客服二维码");return;
					case 10:
						Kit.alert("请填写宝贝内容");return;
					case 11:
						Kit.alert("请填写规格内容");return;
					case 12:
						Kit.alert("请点击添加轮播图片，进行图片的添加！");return;
					case 13:
						Kit.alert("请点击添加详情图片，进行图片的添加！");return;
					case 14:
						Kit.alert("添加分公司错误");return;
					case 16:
						Kit.alert("已选中赠送优惠，请选择赠送的积分值选项");return;
					case 17:
						Kit.alert("已选中赠送优惠积分类别，请填写积分值");return;
					case 18:
						Kit.alert("已选中赠送优惠折扣类别，请填写折扣");return;
					case 19:
						Kit.alert("已选中赠送优惠优惠券类别，请填写优惠券");return;
					case -1:
						Kit.alert("网络繁忙...，请重试");
						editDialog.close();
						return; 
					case 0:
						onEditSuccess(data.object);
						editDialog.close();
						return;
					}
				}
			});
		}
	});
}); 

 $(document).ready(function(){
    $("#addTable").click(function(){
       var tr="<tr><td style=\"font-size: 14px;text-align: center;\"><input type=\"checkbox\" name=\"check\" checked=\"checked\" />"+
       "</td><td style=\"font-size: 14px;text-align: center;\"><input type=\"text\" name=\"name\" maxlength=\"10\" style=\"width:195px;height:30px;\"/>"+
       "</td><td style=\"font-size: 14px;text-align: center;\"><input type=\"text\" name=\"number\"  onkeyup=\"(this.vads=function(){this.value=this.value.replace(/[^0-9]+/,'');}).call(this)\" onblur=\"this.vads();\" style=\"width:195px;height:30px;\" />"+
       "</td><td style=\"font-size: 14px;text-align: center;\"><input type=\"text\" name=\"price\" onkeyup=\"(this.vads=function(){this.value=this.value.replace(/[^0-9]+/-.,'');}).call(this)\" onblur=\"this.vads();\" style=\"width:195px;height:30px;\" />"+
       "</td></tr>";
              $("#tableb").append(tr);
    });
    $("#deleteTable").click(function(){
        var check = document.getElementsByName("check");
        for(var i=0;i<check.length;i++){
            if(check[i].checked){
                 document.getElementById('tableb').deleteRow(i);
                 i--;
            }
        }
    });
     $("#deleteTablea").click(function(){
        var check = document.getElementsByName("checks");
        var ths=check.length;
        var numb=parseFloat($("#chooseNum").html());
        for(var i=0;i<check.length;i++){
            if(check[i].checked){          
                 document.getElementById('tablea').deleteRow(i);
                 i--;           
                 numb--;            
                if(numb<0){
                	numb=0;
                } 
            }       
        }
        $("#chooseNum").text((numb));
        $("#storeid").val((numb));
    })
}) 
  var addStoreDialog;
 function addStore(){
	addStoreDialog = Kit.dialog("添加分公司","${BASE_PATH}/ecard/goods/chooseAllStore",{closable:true,size:'size-wide'}).open();
}  

function onStoreChoosed(storeid,title,address,tel){
	var trs= $("#tablea tr");
	var array=new Array();
	var numb=parseFloat($("#chooseNum").html());
	for (var i = 0; i < trs.length; i++) {
		var tds = $(trs[i]).children();
		var sid = $(tds[0]).find("#ids").val();
		array.push(sid);
	}
	if(contains(array,storeid)){
		alert("该分公司已添加");    
	}else{
	 var tr="<tr><td style=\"font-size: 14px;text-align: center;\"><input type=\"checkbox\" id=\"ids\" checked=\"checked\" name=\"checks\" value='"+storeid+"'/>"+
     "</td><td style=\"font-size: 14px;text-align: center;\">"+title+
     "</td><td style=\"font-size: 14px;text-align: center;\">"+address+
     "</td><td style=\"font-size: 14px;text-align: center;\">"+tel+
     "</td></tr>";
     $("#tablea").append(tr);
     $("#chooseNum").text((numb+1));
     $("#storeid").val((numb+1));
	}
}
function contains(arr, obj) {  
    var i = arr.length;  
    while (i--) {  
        if (arr[i] === obj) {  
            return true;  
        }  
    }  
    return false;  
} 


$("#gbattr").hide();
$("#zsnumattr").hide();
$("#gbfpperson").hide();
$("#zspointnum").hide();
$("#zsdedunum").hide();
$("#zscouponnum").hide();
$("#payonlyactivity").hide();
$("#oppoint").hide();
$("#opdedu").hide();
$("#opcoupon").hide();
$("#paymoneyandactivity").hide();
$("#muchsellerprice").hide();
$("#mppoint").hide();
$("#mpdedu").hide();
$("#mpcoupon").hide();
$(".mpay").click(function(){
	var v = $('input[name="multipay"]').filter(':checked').val(); 
	if(v==1){
		$("#sellerprice").show();
		$("#payonlyactivity").hide();
		$("#oppoint").val("");
		$("#opdedu").val("");
		$("#opcoupon").val("");
		$("#paymoneyandactivity").hide();
		$("#muchsellerprice").val("");
		$("#mppoint").val("");
		$("#mpdedu").val("");
		$("#mpcoupon").val("");
	}else 
	if(v==2){
		$("#sellerprice").hide();
		$("#sellerprice").val("");
		$("#paymoneyandactivity").hide();
		$("#mppoint").val("");
		$("#mpdedu").val("");
		$("#mpcoupon").val("");
		$("#payonlyactivity").show();
		$("#payonlyactivity").click(function(){
			 var vs = $('input[name="onlypaypoint"]').filter(':checked').val(); 
			 if(vs==1){
				 $("#oppoint").show();
			 }else{
				 $("#oppoint").hide();
				 $("#oppoint").val("");
			 }
			 var vs = $('input[name="onlypaydedu"]').filter(':checked').val(); 
			 if(vs==1){
				 $("#opdedu").show();
			 }else{
				 $("#opdedu").hide();
				 $("#opdedu").val("");
			 }
			 var vs = $('input[name="onlypaycoupon"]').filter(':checked').val(); 
			 if(vs==1){
				 $("#opcoupon").show();
			 }else{
				 $("#opcoupon").hide();
				 $("#opcoupon").val("");
			 }		 
		});
	}else if(v==3){
		$("#sellerprice").hide();
		$("#sellerprice").val("");
		$("#payonlyactivity").hide();
		$("#oppoint").val("");
		$("#opdedu").val("");
		$("#opcoupon").val("");
		$("#paymoneyandactivity").show();
		$("#paymoneyandactivity").click(function(){
			var vsp= $('input[name="mpayprice"]').filter(':checked').val(); 
			if(vsp==1){
				$("#muchsellerprice").show();
			}else{
				$("#muchsellerprice").hide();
				$("#muchsellerprice").val("");
			}
			var vsp= $('input[name="mpaypoint"]').filter(':checked').val(); 
			if(vsp==1){
				$("#mppoint").show();
			}else{
				$("#mppoint").hide();
				$("#mppoint").val("");
			}
			var vsd = $('input[name="mpaydedu"]').filter(':checked').val(); 
			if(vsd==1){
				$("#mpdedu").show();
			}else{
				$("#mpdedu").hide();
				$("#mpdedu").val("");
			}
			var vsc = $('input[name="mpaycoupon"]').filter(':checked').val(); 
			if(vsc ==1){
				$("#mpcoupon").show();
			}else{
				$("#mpcoupon").hide();
				$("#mpcoupon").val("");
			}		 
		});
	}
});
/* 是否团购 */
$(".group").click(function(){
	var v = $('input[name="groupbuying"]').filter(':checked').val(); 
	if(v==1){
		$("#gbattr").hide();
	}else if(v==2){
		$("#gbattr").show();
		/* 团购方法 */	 
		$(".gmethod").click(function(){
			var vs = $('input[name="gbmethod"]').filter(':checked').val(); 
			if(vs==1){
				$("#gbfpperson").hide();
			}else if(vs==2){
				$("#gbfpperson").show();
			}else if(vs==3){
				$("#gbfpperson").show();
			}
		});
	}
}); 
/* 是否赠送优惠 */	 
$(".zactivity").click(function(){
	var v = $('input[name="zsactivity"]').filter(':checked').val(); 
	if(v==1){
		$("#zsnumattr").hide();
	}else if(v==2){
		$("#zsnumattr").show();
		$("#zsnumattr").click(function(){
			 var vsp = $('input[name="zspoint"]').filter(':checked').val(); 
			 if(vsp==1){
				 $("#zspointnum").show();
			 }else{
				 $("#zspointnum").hide();
				 $("#zspointnum").val("");
			 }
			 var vsd = $('input[name="zsdedu"]').filter(':checked').val(); 
			 if(vsd==1){
				 $("#zsdedunum").show();
			 }else{
				 $("#zsdedunum").hide();
				 $("#zsdedunum").val("");
			 }
			 var vsc = $('input[name="zscoupon"]').filter(':checked').val(); 
			 if(vsc==1){
				 $("#zscouponnum").show();
			 }else{
				 $("#zscouponnum").hide();
				 $("#zscouponnum").val("");
			 }		 
		});
	}	
});

 var imagesDialog;
 function toUploadImages(){
 	imagesDialog = Kit.dialog("轮播图片","${BASE_PATH}/bus/goods/base/imageIndex/${goods.LunBoNum}",{closable:true,size:"size-wide"}).open();
 }
function deltTablElement(){
     var check = document.getElementsByName("specChecks");
     var ths=check.length;
     var numb=parseFloat($("#chooseSpecNum").html());
     for(var i=0;i<check.length;i++){
         if(check[i].checked){
              document.getElementById('tablespec').deleteRow(i);
              i--;
              numb--;
         }
     }
     $("#chooseSpecNum").text((numb));
     $("#specid").val((numb));
 } 
 //详情图片
 var imagesXiang;
 function toXiang(){
 	imagesXiang = Kit.dialog("详情图片","${BASE_PATH}/bus/goods/base/imageDetailIndex/${goods.LunBoNum}",{closable:true,size:"size-wide"}).open();
 }
//点击事件取下级的值
$("#categoryonid").change(function(){
	categoryonid=$("#categoryonid").val();
	  $.ajax({
           type: "POST",
           url: "${BASE_PATH}/bus/goods/base/categoryonid",
           data: {"categoryonid" : categoryonid},
           dataType: "json",
           traditional: true,
           success: function(data){
			$("#categorytwid").empty(); 
			$("#categorytwid").append("<option value=''>请选择二级分类</option>");
			console.log(categoryonid);
			console.log(categorytwid);
			for(var i=0; i<data.object.length;i++){
				$("#categorytwid").append("<option value='"+data.object[i].categoryId+"'>"+data.object[i].categoryName+"</option>");
				console.log(data.object[i].categoryId);
				}
           }
       });
    });
$("#categorytwid").change(function(){
	categorytwid=$("#categorytwid").val();
	  $.ajax({
           type: "POST",
           url: "${BASE_PATH}/bus/goods/base/categorytwid",
           data: {"categorytwid" : categorytwid},
           dataType: "json",
           traditional: true,
           success: function(data){
          	   $("#categorythid").empty(); 
               $("#categorythid").append("<option value=''>请选择三级分类</option>");
               for(var i=0; i<data.object.length;i++){
              	 $("#categorythid").append("<option value='"+data.object[i].categoryId+"'>"+data.object[i].categoryName+"</option>");
               }
           }
       });
    });
$("#categorythid").change(function(){
	categorythid=$("#categorythid").val();
	
	  $.ajax({
           type: "POST",
           url: "${BASE_PATH}/bus/goods/base/categorythid",
           data: {"categorythid" : categorythid},
           dataType: "json",
           traditional: true,
           success: function(data){
          	   $("#categoryfoid").empty(); 
               $("#categoryfoid").append("<option value=''>请选择四级分类</option>");
               for(var i=0; i<data.object.length;i++){
              	 $("#categoryfoid").append("<option value='"+data.object[i].categoryId+"'>"+data.object[i].categoryName+"</option>");
               }
           }
       });
    });
/* $("#categoryfoid").change(function(){
	categoryfoid=$("#categoryfoid").val();
    }); */
    
</script>

<form id="addForm" action="${BASE_PATH}/ecard/goods/doEdit" method="post" autocomplete="off" class="form-horizontal" enctype="multipart/form-data" style="">
	
	<div class="form-group"  style="margin-left: 20px">
		<label class=" control-label" style="margin-left: 50px;font-size: 18px;">商品基本信息</label>
	</div>
	<hr style=" height:2px;border:none;border-top:2px solid black;" />
	<div class="form-group">
	    <label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>商品名称</label>
	    <div class="col-lg-9">
        	<input type="text" name="names" id="names" class="form-control" value="${goods.name}" required maxlength="40">
        	<input type="text" id="goodsid" name="goodsid" hidden="hidden" value="${goods.id }"/>
	    </div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label"><span style="margin-right:10px; color:red;">*</span>商品主图</label>
		<div class="col-sm-10">
			<input type="file" id="goodsthumb" name="goodsthumb" style="width:30%;" accept="image/jpg,image/png" title="添加商品Logo图" <c:if test="${goods.thumb!=null}">data-val="${goods.thumb}" </c:if>>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label"><span style="margin-right:10px; color:red;">*</span>商品轮播图</label>
		<div class="col-sm-10">
		 <input type='button' value='编辑轮播图' onclick="toUploadImages();" style="background-color: #428bca;width: 89.81px;height: 32px;color: white;border: 2px solid;background-image: linear-gradient(to bottom,#5bc0de 0,#428bca 100%);"/> 
		</div>
		<div class="col-lg-offset-2 p-t-5 col-lg-9"><span class="text-success"></span></div>
	</div> 
	<!-- =========================================================商品分类======================================================== -->
	<div class="form-group">
	    <label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>商品类别</label>
	    <div class="col-sm-2">
        	<select name="categoryonid" id="categoryonid" class="form-control" required >
       			<option value="">一级分类</option>
       			<c:forEach items="${oneCategories}" var="category" varStatus="s">
					<option value="${category.categoryId}" <c:if test="${goods.categoryonid==category.categoryId}">selected</c:if> >${category.categoryName}</option>	
				</c:forEach>
        	</select>
	    </div>
	
	    <div class="col-sm-2">
        	<select name="categorytwid" id="categorytwid" class="form-control" required >
        		<option value="" 
        		<c:forEach items="${twoCategories}" var="category" varStatus="s">
					<option value="${category.categoryId}" <c:if test="${goods.categorytwid==category.categoryId}">selected</c:if> >${category.categoryName}</option>	
				</c:forEach>
				>二级分类</option>
        	</select>
	    </div>
	
	    <div class="col-sm-2">
		    <select name="categorythid" id="categorythid" class="form-control" required >
	        	<option value=""
        		<c:forEach items="${threeCategories}" var="category" varStatus="s">
					<option value="${category.categoryId}" <c:if test="${goods.categorythid==category.categoryId}">selected</c:if> >${category.categoryName}</option>	
				</c:forEach>
				>三级分类</option>
	        </select>
	    </div>
	
	    <div class="col-sm-2">
		    <select name="categoryfoid" id="categoryfoid" class="form-control" required >
	        	<option value=""
        		<c:forEach items="${fourCategories}" var="category" varStatus="s">
					<option value="${category.categoryId}" <c:if test="${goods.categoryfoid==category.categoryId}">selected</c:if> >${category.categoryName}</option>	
				</c:forEach>
				>四级分类</option>
	        </select>
	    </div>
	</div>
	<div class="form-group">
	    <label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>市场售价</label>
	    <div class="col-lg-9">
        	<input type="text" name="sellPrice" id="sellPrice" class="form-control" value="${goods.sellPrice}" onkeyup="(this.v3=function(){this.value=this.value.replace(/[^0-9-.]+/,'');}).call(this)" onblur="this.v3();" placeholder="请输入商品市场价" />
	    </div>
	</div>
	<div class="form-group">
		<label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>商城售价</label>
		<div class="col-lg-9">
			<input type="text" name="marketPrice" id="marketPrice" class="form-control" value="${goods.marketPrice}" onkeyup="(this.v3=function(){this.value=this.value.replace(/[^0-9-.]+/,'');}).call(this)" onblur="this.v3();" placeholder="请输入商品商城价" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>库存数量</label>
		<div class="col-lg-9">
			<input type="text" name="countnum" id="countnum" class="form-control" value="${goods.countnum}" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" placeholder="请输入数字" />
		</div>
	</div>
	<div class="form-group">
		<label class="col-lg-2 control-label">商品货号</label>
		<div class="col-lg-9">
			<input type="text" id="goodsNum" name="goodsNum" class="form-control" value="${goods.goodsNum}" placeholder="请输入第三方商品货号">
		</div>
	</div>
	<!-- 是否赠送优惠 -->
	<div class="form-group">
   	 <label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>赠送优惠</label>
	    <div class="col-lg-9 zactivity" >
	        <label><input name="zsactivity" type="radio" value="1" <c:if test="${goods.zsactivity==1}">checked</c:if> />否   </label>
			<label><input name="zsactivity" type="radio" value="2" <c:if test="${goods.zsactivity==2}">checked</c:if> />是   </label>
			<div style="margin-right: 30px;" id="zsnumattr">
				<label><input name="zspoint" type="checkbox" value="1" <c:if test="${goods.zspointnum!=null&&goods.zspointnum!=0}">checked</c:if> /> 积分值 
					<input type="text" name="zspointnum" id="zspointnum" value="${goods.zspointnum}" size="12"  placeholder="请输入数字" /></label><br>
				<label><input name="zsdedu" type="checkbox" value="1"  <c:if test="${goods.zsdedunum!=null&&goods.zsdedunum!=0}">checked</c:if> /> 抵扣券
					<input type="text" name="zsdedunum" id="zsdedunum" value="${goods.zsdedunum}" size="12" placeholder="请输入数字" /></label><br>
				<label><input name="zscoupon" type="checkbox" value="1" <c:if test="${goods.zscouponnum!=null&&goods.zscouponnum!=0}">checked</c:if> /> 惠券
					<input type="text" name="zscouponnum" id="zscouponnum" value="${goods.zscouponnum}" size="12" placeholder="请输入数字" /></label>
			</div>
   		</div>
   	</div>
	<div class="form-group">
	    <label class="col-lg-2 control-label"><span style="margin-right:10px; color:red;">*</span>适用分公司</label>
	    <div class="col-lg-9">
    		<input type="button" value="增加分公司" onclick="addStore();" style="background-color: #0080ff;color: white;border: 2px solid;background-image: linear-gradient(to bottom,#5bc0de 0,#428bca 100%);"/> <span>已选分公司(<span id="chooseNum" >0</span>)</span>
    		<input type='button' value='删除分公司' id='deleteTablea' style="background-color: #ff8080;color: white;border: 2px solid;background-image: linear-gradient(to bottom,#ff8080 0,#ff0000 100%);"/>
    		<input type="text" id="storeid" name="storeid" hidden="hidden" value="1"/>
	    </div>
	</div>
	<div class="form-group">
	 <label class="col-lg-2 control-label"></label>
	     <div class="col-lg-9">
	     	<table id="tablea" style="width: 100%" border="1">
     			<tr>
     				<th  width="5%"  style="font-size: 14px;text-align: center;"><input type="checkbox"  name="checks" hidden="hidden"/>选择</th>
     				<th  width="15%" style="font-size: 14px;text-align: center;">分公司名称</th>
     				<th  width="20%" style="font-size: 14px;text-align: center;">分公司地址</th>
     				<th  width="10%" style="font-size: 14px;text-align: center;">分公司电话</th>
     			</tr>
	     	</table>
	    </div>
	</div>
	<hr style=" height:1px;border:none;border-top:1px solid black;" /> 
	<div class="form-group">
	 <label class="col-lg-2 control-label">原有分公司</label>
	     <div class="col-lg-9">
	     	<table id="tabled" style="width: 100%" border="1">
     			<tr>
     				<th  width="15%" style="font-size: 14px;text-align: center;">分公司名称</th>
     				<th  width="20%" style="font-size: 14px;text-align: center;">分公司地址</th>
     				<th  width="10%" style="font-size: 14px;text-align: center;">分公司电话</th>
     			</tr>
     			<c:if test="${fn:length(store) > 0}">
					<c:forEach var="ad" items="${store}" varStatus="s">
						<tr>
							 <td style="font-size: 14px;text-align: center;">${ad.title }</td>
							 <td style="font-size: 14px;text-align: center;">${ad.address}</td>
							 <td style="font-size: 14px;text-align: center;">${ad.tel}</td>
						<tr>
					</c:forEach>
				</c:if>
	     	</table>
	    </div>
	</div>
		<div class="form-group">
		<label class=" control-label" style="margin-left: 50px;font-size: 18px;">商品详情</label>
	</div>
		<hr style=" height:2px;border:none;border-top:2px solid black;"/>
	

	<div class="form-group">
	    <label class="col-lg-2 control-label">商品简介</label>
	    <div class="col-lg-9">
	        <textarea rows="5" cols="80" name="shortinfo" onchange="this.value=this.value.substring(0, 200)" onkeydown="this.value=this.value.substring(0, 200)" onkeyup="this.value=this.value.substring(0, 200)" id="shortinfo">${goods.shortInfo }</textarea>
	    </div>
	</div>
	<div class="form-group">
			<label class="col-lg-2 control-label"><span class="must-fill">*</span>商品内容：</label>
			<div class="col-lg-8">
				 <textarea name="content" class="form-control" rows="60" placeholder="" required></textarea>
			</div>
	</div> 

	<div class="form-group">
		<label class="col-sm-2 control-label"><span style="margin-right:10px; color:red;">*</span>详情图片</label>
		<div class="col-sm-10">
		 <input type='button' value='添加详情图片' onclick="toXiang();" style="background-color: #337ab7;width: 100px;height: 32px;color: white;border: 2px solid;background-image: linear-gradient(to bottom,#5bc0de 0,#428bca 100%);"/> 
		</div>
		<div class="col-lg-offset-2 p-t-5 col-lg-9"><span class="text-success"></span></div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label">备注</label>
		<div class="col-sm-10">
	        <textarea rows="5" cols="80" name="beizhu" onchange="this.value=this.value.substring(0, 200)" onkeydown="this.value=this.value.substring(0, 200)" onkeyup="this.value=this.value.substring(0, 200)" >${goods.beizhu}</textarea>
		</div>
	</div>
	<%-- <div class="form-group">
		<label class="col-sm-2 control-label"><span style="margin-right:10px; color:red;">*</span>客服二维码</label>
		<div class="col-sm-10">
			<input type="file" id="Qrthumb" name="Qrthumb"  style="width:30%;" accept="image/jpg,image/png" title="添加客服二维码" <c:if test="${goods.Qrthumb!=null}">data-val="${goods.Qrthumb}" </c:if> >
		</div>
	</div> --%>
	<div class="row">
		<div class="col-lg-6"><button class="btn btn-primary col-sm-3 pull-right" type="submit" >提交</button></div>
		<div class="col-lg-6"><button class="btn btn-default col-sm-3 pull-left"  type="button" onclick="javascript:editDialog.close();" >取消</button></div>
	</div>
	<input type="hidden" name="thumbOld" value="${goods.thumb}"/>
	<input type="hidden" name="QrthumbOld" value="${goods.Qrthumb}"/>
	<input type="hidden" name="id" value="${goods.id}"/>
	<input type="hidden" name="LunBoNum" value="${goods.LunBoNum}"/>
</form>
</body>
</html>